APPNAME=mqtt_aliyun

SRCS=mqtt_aliyun.c

CJSON_DIR=./3rdlib/cJSON-1.7.14
INIPARSER_DIR=./3rdlib/iniparser-4.1/
MOSQUITTO_DIR=./3rdlib/mosquitto-1.6.9
CONF_DIR=./conf

CFLAGS=-I ${CJSON_DIR}     
CFLAGS+=-I ${INIPARSER_DIR}/src
CFLAGS+=-I ${MOSQUITTO_DIR}/lib
CFLAGS+=-I ${CONF_DIR}

LDFLAGS=-L${CJSON_DIR} -lcjson
LDFLAGS+=-L ${INIPARSER_DIR} -liniparser
LDFLAGS+=-L ${MOSQUITTO_DIR} -lmosquitto
LDFLAGS+=-L ${CONF_DIR} -lconf
LDFLAGS+=-lm

CC = gcc

all:
	${CC} ${CFLAGS} ${SRCS} -o ${APPNAME} ${LDFLAGS} 

run:
	./${APPNAME}

clean:
	rm -f mqtt_aliyun
	rm -f a.out
	rm -f *.o
	rm -f *.i

